
#include <string>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include "rc4wrapper.h"
using namespace std;






int main(int argc, char **argv) {

    string cleartext = "中国北京12345$abcde%ABCDE@！！！";
    string ciphertext = "";
    string key = "beijingchina1234567890ABCDEFGH!!!";

    RC4Wrapper rc4;


    string decrypt;
    rc4.Enc(cleartext.c_str(), cleartext.size(), key.c_str(), key.size(), ciphertext);
    rc4.Enc(ciphertext.c_str(), ciphertext.size(), key.c_str(), key.size(), decrypt);


    cout<<"src cleartext: "<<cleartext<<endl;
    cout<<"genarate ciphertext: "<<ciphertext<<endl;
    cout<<"src ciphertext: "<<ciphertext<<endl;
    cout<<"genarate cleartext: "<<decrypt<<endl;

    if (strcmp(cleartext.c_str(), decrypt.c_str()) == 0)
        cout<<"RC4 crypto ok!!!"<<endl;
    else
        cout<<"RC4 crypto error!!!"<<endl;

    return 0;
}
